<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
  <head>
    <title>Facebook Programming</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div id="fb-root"></div>
		<script>
		  window.fbAsyncInit = function() {
			FB.init({
			  appId      : '154298721334849', // App ID
			  channelURL : '//www.facebooklikeyou.com/channel.php', // Channel File
			  status     : true, // check login status
			  cookie     : true, // enable cookies to allow the server to access the session
			  oauth      : true, // enable OAuth 2.0
			  xfbml      : true  // parse XFBML
			});

			// Additional initialization code here
			FB.getLoginStatus(function(response) {
			  if (response.authResponse) {
				// logged in and connected user, someone you know
				var str = "<status>"+response.status+"</status>";
				str += "<data>";
				str += "<userID>"+response.authResponse.userID+"</userID>";
				str += "<signedRequest>"+response.authResponse.signedRequest+"</signedRequest>";
				str += "<accessToken>"+response.authResponse.accessToken+"</accessToken>";
				str += "<expiresIn>"+response.authResponse.expiresIn+"</expiresIn>";
				str += "</data>";
				document.getElementById("login-info").innerHTML = str;
			  } else {
					FB.login(function(response) {
					   if (response.authResponse) {
						 FB.api('/me', function(response) {
							 document.getElementById("login-info").innerHTML = 'Good to see you, ' + response.name + '.';
						   FB.logout(function(response) {
							 document.getElementById("login-info").innerHTML = 'Logged out.';
						   });
						 });
					   } else {
						 document.getElementById("login-info").innerHTML = 'User cancelled login or did not fully authorize.';
					   }
					 }, {scope: 'email'});
			  }
			});
			
		  };

		  // Load the SDK Asynchronously
		  (function(d){
			 var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
			 js = d.createElement('script'); js.id = id; js.async = true;
			 js.src = "//connect.facebook.net/en_US/all.js";
			 d.getElementsByTagName('head')[0].appendChild(js);
		   }(document));
			
		
	</script>
	<div id="login-info"></div>
  </body>
</html>
